package cn.mesmile.nacos.model;

import cn.mesmile.nacos.dto.Datas;
import cn.mesmile.nacos.dto.StatisticalResults;

import java.util.List;

/**
 * @author zb
 * @date 2021/6/18 23:38
 * @Description:
 */
public class StatisticsContext {

    private Strategy strategy;

    public StatisticsContext (Strategy strategy) {
        this.strategy = strategy;
    }

    public StatisticalResults executeStrategy (List<Datas> datasList) {
        StatisticalResults result = strategy.getStatisticsResult(datasList);
        return result;
    }

}
